<%@ page language="java" contentType="text/html; charset=utf-8" pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="">
<meta name="keywords" content="">
<title>TEST</title>
<script type="text/javascript" src="js/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="js/RSA.js"></script>
<script type="text/javascript" src="js/BigInt.js"></script>
<script type="text/javascript" src="js/Barrett.js"></script>
<script type="text/javascript" src="js/jQuery.md5.js"></script>
<script type="text/javascript" src="js/jquery.jcryption-1.1.js"></script>
<script type="text/javascript">


     
	function ckSub(){



		var rsa_n = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCbeiyc45WgxXN2WeHJD1Zawrg3wupkZaFHssEJucQ0JJTN28kpz605ZD36ZI3jpGyEzBZXYWypONvZoAwzdvTPWoQM4H9W9WzaN6zDcsQeF8E3ae0rZkCYnolj5v73zLtdT3oVdS8QyoP3siGS1x16VQ2ZadgLIkqPQNE0meWoowIDAQAB+iua06CwCpNx+jf4muQRFhqLPoUsaJVkAtxv/MJKr0FwwhwWxQrOD50rIGAnSZw4NgC+18OjQB69Ht7KsVpV0gl07wIDAQAB";  
	      

	    setMaxDigits(131); //131 => n的十六进制位数/2+3  
	    var key      = new RSAKeyPair("10001", '', rsa_n); //10001 => e的十六进制  
	    var password = $("#password").val();  
	    password = encryptedString(key, password); //不支持汉字  
	  
	    alert(password); //test  



	    var a ="username=123&password="+password;

		

$.ajax({
	  type:"post",
	  url: 'http://10.3.13.212:8080/login',
	  data:a,
	  success: function(data){
	                 console.log(data)     
	            } 
	         });



	    
	}




        
</script>

<style type="text/css">
</style>
</head>
<body>
	<form id="form" name="form" action="LoginServlet" method="post">
		<input id="username" name="username" type="text" value="" />
		<input id="password" name="password" type="text" value="" />
		
		<input id="pwdRsa" name="pwd" type="hidden" value="" />
		<input type="button" value="登录" onclick="ckSub()" />
	</form>
	
</body>
</html>